﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace BookOnline.Data
{
    public class Member
    {
        private string _MemberID;
        private string _MemberName;
        private string _MemberUser;
        private string _MemberPass;
        private string _MemberAdd;
        private string _MemberPhone;
        private string _MemberBD;
        private string _MemberSex;
        private string _MemberEmail;

        public string MemberID { get { return _MemberID; } set { _MemberID = value; } }
        public string MemberName { get { return _MemberName; } set { _MemberName = value; } }
        public string MemberUser { get { return _MemberUser; } set { _MemberUser = value; } }
        public string MemberPass { get { return _MemberPass; } set { _MemberPass = value; } }
        public string MemberAdd { get { return _MemberAdd; } set { _MemberAdd = value; } }
        public string MemberPhone { get { return _MemberPhone; } set { _MemberPhone = value; } }
        public string MemberBD { get { return _MemberBD; } set { _MemberBD = value; } }
        public string MemberSex { get { return _MemberSex; } set { _MemberSex = value; } }
        public string MemberEmail { get { return _MemberEmail; } set { _MemberEmail = value; } }

        public Member MemberIDataReader(IDataReader dr)
        {
            Member obj = new Member();
            obj.MemberID = (dr["MemberID"] is DBNull) ? string.Empty : dr["MemberID"].ToString();
            obj.MemberName = (dr["MemberName"] is DBNull) ? string.Empty : dr["MemberName"].ToString();
            obj.MemberUser = (dr["MemberUser"] is DBNull) ? string.Empty : dr["MemberUser"].ToString();
            obj.MemberPass = (dr["MemberPass"] is DBNull) ? string.Empty : dr["MemberPass"].ToString();
            obj.MemberAdd = (dr["MemberAdd"] is DBNull) ? string.Empty : dr["MemberAdd"].ToString();
            obj.MemberPhone = (dr["MemberPhone"] is DBNull) ? string.Empty : dr["MemberPhone"].ToString();
            obj.MemberBD = (dr["MemberBD"] is DBNull) ? string.Empty : dr["MemberBD"].ToString();
            obj.MemberSex = (dr["MemberSex"] is DBNull) ? string.Empty : dr["MemberSex"].ToString();
            obj.MemberEmail = (dr["MemberEmail"] is DBNull) ? string.Empty : dr["MemberEmail"].ToString();
            return obj;
        }
    }
}
